<?php
namespace app\index\controller;

use Des3\DES3;

class Set extends CheckMember
{
    /**
     * 设置
     * @return \think\response\View
     */
    public function index()
    {
        return view();
    }

    /**
     * 关于就行
     * @return \think\response\View
     */
    public function about() {
        return view();
    }

    /**
     * 设置支付密码页面
     * @return \think\response\Json|\think\response\View
     */
    public function safe_password() {
        if (request()->isAjax()) {
            $safe_password = input('param.safe_password');
            $des = new DES3();
            $param = [
                'member_id' => session('member_id'),
                'safe_password' => $des->encrypt($safe_password),
                'code' => input('param.code')
            ];
            $data = $this->local_invoke_api('save_safe_password', $param);
            return json($data);
        } else {
            return view();
        }
    }
}
